package com.ly.count.room;


import com.ly.count.room.bo.CPlusRoomUserBO;
import com.ly.count.room.param.CPlusRoomUserPage;
import com.ly.count.room.po.CPlusRoomUser;
import com.ly.count.room.vo.CPlusRoomUserVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import com.ly.count.http.CPlusResponse;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.bind.annotation.RequestBody;
import com.ly.count.service.room.CPlusRoomUserService;
import org.springframework.web.bind.annotation.RestController;

import static com.ly.count.CPlusConstants.CPLUS_INTERFACE_FOR_WEB;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author liaoyong
 * @since 2024-10-03
 */
@RestController
@RequestMapping(CPLUS_INTERFACE_FOR_WEB+"/cPlusRoomUser")
@Tag(name = "房间接口")
public class CPlusRoomUserController {
    @Autowired
	@Resource(name = "cPlusRoomUserService")
	private CPlusRoomUserService cPlusRoomUserService;

	@Operation(summary= "详情")
    @RequestMapping(method = RequestMethod.POST, value = "/detail")
	public CPlusResponse<CPlusRoomUserVO> detail(@RequestBody CPlusRoomUser cPlusRoomUser){
		return cPlusRoomUserService.selectOne(cPlusRoomUser);
	}
	
	@RequestMapping(method = RequestMethod.POST, value = "/page")
	@Operation(summary = "分页列表")
	public CPlusResponse<Page<CPlusRoomUser>> page(@RequestBody CPlusRoomUserPage cPlusRoomUserPage){
		return cPlusRoomUserService.pageList(cPlusRoomUserPage);
	}
	
	@RequestMapping(method = RequestMethod.POST, value = "/add")
	@Operation(summary= "新增")
	public CPlusResponse<Object> add(@RequestBody CPlusRoomUserBO clusRoomUserBO){
	   
	   return cPlusRoomUserService.add(clusRoomUserBO);
	}
	@Operation(summary= "编辑")
	@RequestMapping(method = RequestMethod.POST, value = "/modify")
	public CPlusResponse modify(@RequestBody CPlusRoomUser cPlusRoomUser){
	
	   return cPlusRoomUserService.modify(cPlusRoomUser);
	}
	
}

